﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Dainfo.Master" CodeBehind="ConsultarVendas.aspx.vb" Inherits="Dainfo.ControleEstoque.Web.ConsultarVendas" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderTituloPagina" runat="server">
    <p>
        Vendas</p>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PlaceHolderPrincipal" runat="server">
    <div style="width: 600px">
        <asp:UpdatePanel ID="upVendas" runat="server">
            <ContentTemplate>
                <asp:GridView ID="gvVendas" runat="server" AutoGenerateColumns="False" CssClass="grid"
                    BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px"
                    CellPadding="3" CellSpacing="2">
                    <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
                    <Columns>
                        <asp:CommandField ShowSelectButton="True" />
                        <asp:BoundField DataField="Codigo" HeaderText="Código" />
                        <asp:BoundField DataField="Data" HeaderText="Data" DataFormatString="{0:dd/MM/yyyy}" />
                        <asp:TemplateField HeaderText="Cliente">
                            <ItemTemplate>
                                <a href='../Clientes/CadastroClientes.aspx?id=<%#DataBinder.Eval(Container.DataItem, "Cliente.Codigo")%>'><%#DataBinder.Eval(Container.DataItem, "Cliente.Nome")%></a>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Valor Total da Venda">
                            <ItemTemplate>
                                Preço Total:
                                <%#Me.Total(Container.DataItemIndex).ToString("C")%>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
                    <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
                </asp:GridView>
                <div style="margin-top: 10px; background-color: #DEBA84;" class="grid">
                    Itens
                </div>
                <asp:GridView ID="gvItens" runat="server" BackColor="#DEBA84" CssClass="grid" BorderColor="#DEBA84"
                    BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2" EmptyDataText="Não há itens nessa venda."
                    AutoGenerateColumns="False">
                    <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
                    <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
                    <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
                    <Columns>
                        <asp:TemplateField HeaderText="Produto">
                            <ItemTemplate>
                                <%#DataBinder.Eval(Container.DataItem, "Produto.Descricao")%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Preço Unitário">
                            <ItemTemplate>
                                <%#String.Format("{0:c}", DataBinder.Eval(Container.DataItem, "Produto.ValorVenda"))%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="Quantidade" HeaderText="Quantidade" />
                        <asp:TemplateField HeaderText="Preço Total">
                            <ItemTemplate>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
